#ifndef __SOCKET_OPERATE_H__
#define __SOCKET_OPERATE_H__

#include <netinet/in.h>

#define BLOCK    0
#define NONBLOCK 1

extern INT32 netbyteorder_ipaddr_construct(INT8 *ip, UINT16 port, struct sockaddr_in *addr);
extern INT32 netbyteorder_ipaddr_deconstruct(struct sockaddr_in *addr, INT8 *ip, UINT16 *port);
extern INT32 socket_tcp_create(INT8 *ip, UINT16 port, INT32 *fd);
extern INT32 socket_udp_create(INT8 *ip, UINT16 port, INT32 *fd);
extern INT32 set_block_state(INT32 sockfd, BOOL state);
#endif
